
import {simpleServer} from '@/tools/servers'

/**
 * 区
 */
export class AreaService {
    // 分页查询列表
    static findAreas (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findAreas,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findAreas', body);
    }


    //根据区Id查询区
    static findArea (areaId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findArea ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findArea',body);
    }

    //为了编辑,根据区Id查询区
    static findAreaForEdit(areaId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAreaForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findAreaForEdit',body);
    }

    //为了查看,根据区Id查询区，所有外键字段的名称都已加载
    static findAreaForView(areaId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAreaForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findAreaForView',body);
    }

    //创建新的区
    static createArea() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createArea,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/createArea',body);
    }

    //保存区
    static saveArea(area) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveArea,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/saveArea', body);
    }

    //编辑区
    static updateArea (area) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateArea,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/updateArea', body);
    }

    //根据区Id删除区
    static deleteArea (areaId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteArea,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/deleteArea',body);
    }

    //为了查看,根据区Id查询区，只加载ID 和 名称
    static findAreasWithIdNameById(areaId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAreasWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findAreasWithIdNameById',body);
    }

    //为了查看,根据区 名称 查询区，只加载ID 和 名称
    static findAreasWithIdNameByName(areaName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findAreasWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/Area/findAreasWithIdNameByName',body);
    }


}
